package com.zjm.find.service.impl;

import com.zjm.find.dao.BannerMapper;
import com.zjm.find.dao.ImagesMapper;
import com.zjm.find.pojo.Banner;
import com.zjm.find.pojo.Images;
import com.zjm.find.service.ImagesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ImagesServiceImpl implements ImagesService {

    @Autowired
    private ImagesMapper imagesMapper;

    @Autowired
    private BannerMapper bannerMapper;

    @Override
    public boolean createImg(Images images) {
        return imagesMapper.insertSelective(images) == 1 ? true : false;
    }

    @Override
    public boolean createBanner(Banner banner) {
        return bannerMapper.createBanner(banner) == 1 ? true : false;
    }

    @Override
    public List<Banner> selectBanners(Banner banner) {
        return bannerMapper.selectBanners(banner);
    }

    @Override
    public boolean updateBanner(Banner banner) {
        return bannerMapper.updateBanner(banner) == 1 ? true : false;
    }

    @Override
    public boolean deleteBanner(Banner banner) {
        return bannerMapper.deleteBanner(banner) == 1 ? true : false;
    }
}
